package com.xiaofeng.Hello;

import java.util.Random;

public class Java7 {
    public static void main(String[] args) {
        Random r=new Random();
        int arr[]=new int[10];
        int sum=0;
        for (int i = 0; i < arr.length; i++) {
           arr[i]=r.nextInt(101)+1;
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.printf("%d ",arr[i]);
            sum+=arr[i];
        }
        System.out.printf("\navg=%d",sum/arr.length);
        int cout=0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]<sum/arr.length){
                cout++;
            }
        }
        System.out.printf("\n比平均值小的的数据个数：%d 个",cout);
    }
}
